package com.sdry.common;

/**
 * 通用命名
 * @author chenBin
 * @date 2020-3-2 14:08:37
 * @version 1.0
 */
public enum BaseAPIMessageTypeEnum {
    A001("A001","查询数据为空"),
    A002("A002","该编号容器查出多条，请核实容器信息"),
    A003("A003","没有该编号容器"),
    A004("A004","装框成功"),
    A005("A005","装框失败"),
    A006("A006","提交数据为空"),
    A007("A007","查询司机信息为空"),
    A008("A008","查询车辆信息为空"),
    A009("A009","该容器没有物料"),
    A010("A010","装车成功"),
    A014("A014","装车失败"),
    A011("A011","该车辆或司机有多条，请核实车辆和司机信息"),
    A012("A012","该车辆或司机有无法查询，请核实车辆和司机信息"),
    A013("A013","该工位不存在或查出多条，请核实容器信息"),

    A015("A015","上链条成功"),
    A016("A016","上链条失败"),
    A017("A017","下链条成功"),
    A018("A018","下链条失败"),
    A019("A019","该容器不在对应位置"),
    A020("A020","该库位不存在或查出多条"),
    A021("A021","入库成功"),
    A022("A022","入库失败"),
    A023("A023","出库成功"),
    A024("A024","出库失败"),
    A025("A025","该容器已装车"),
    A026("A026","请输入框码"),
    A027("A027","请选择同一起始位置的物料"),
    A028("A028","该容器物料已收货"),


    A094("A094","操作失败"),
    A095("A095","绑定失败"),
    A096("A096","该库存不足"),
    A097("A097","该编号存在于线上"),
    A098("A098","未找到该编号"),
    A099("A099","该编号重复"),


    ;



    private String code;
    private String name;

    BaseAPIMessageTypeEnum(String code, String name){
        this.code = code;
        this.name = name;
    }

    public String getCode() {
        return code;
    }
    public void setCode(String code) {
        this.code = code;
    }
    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }

    public static String getNameByCode(String code){
        for (BaseAPIMessageTypeEnum value : values()) {
            if(value.code.equals(code)){
                return value.name;
            }
        }
        //没有则返回null；
        return "null";

    }

}
